package com.totowoo.shirodemo.util;

/**
 * 输出当前的代码信息（还有bug）
 * @author Administrator
 *
 */
public class CodeLocation {
	public static void printInfo() {
		StackTraceElement[] stacks = Thread.currentThread().getStackTrace();
		System.out.println("CodeLocationInfo:" + stacks[2].getClassName() + "." + stacks[2].getMethodName() + "["
				+ stacks[2].getFileName() + "(" + stacks[2].getLineNumber() + ")]");
	}
	
	public static void printInfo(String message) {
		printInfo();
		System.out.println("CodeLocationMessage:" + message);
	}

}
